<!--
  Expects the following variables:
  podTemplate
  imagesByDockerReference (optional)
  builds (optional)
  detailed (optional)
  addHealthCheckUrl (optional)
 -->

<!-- Prompt to add health checks if missing. -->
<div ng-if="detailed && addHealthCheckUrl && !(podTemplate | hasHealthChecks)" class="alert alert-info">
  <span class="pficon pficon-info" aria-hidden="true"></span>
  <span ng-if="podTemplate.spec.containers.length === 1">Container {{podTemplate.spec.containers[0].name}} does not have health checks</span>
  <span ng-if="podTemplate.spec.containers.length > 1">Not all containers have health checks</span>
  to ensure your application is running correctly.
  <a ng-href="{{addHealthCheckUrl}}" class="nowrap">Add Health Checks</a>
</div>

<div ng-if="detailed && podTemplate.spec.initContainers.length">
  <h4>Init Containers</h4>

  <div class="pod-template-container">
    <div class="pod-template-block" ng-repeat="container in podTemplate.spec.initContainers">

      <pod-template-container
        pod-template-container="container"
        images-by-docker-reference="imagesByDockerReference"
        builds="builds"
        detailed="detailed"></pod-template-container>

    </div>
  </div>
</div>

<div>
  <h4 ng-if="detailed">Containers</h4>

  <div class="pod-template-container">
    <div class="pod-template-block" ng-repeat="container in podTemplate.spec.containers">

      <pod-template-container
        pod-template-container="container"
        images-by-docker-reference="imagesByDockerReference"
        builds="builds"
        detailed="detailed"></pod-template-container>

      <div
        extension-point
        extension-name="container-links"
        extension-types="link dom"
        extension-args="[container, podTemplate]"></div>

    </div>
  </div>
</div>
